package org.simp.core.message;

import org.simp.core.body.SimpBody;
import org.simp.core.head.SimpHeader;
import org.simp.exception.SimpIncompleteException;

public interface SimpMessage {

	
	public byte[] encode() throws SimpIncompleteException ;
	
	public void decode(byte[] data) throws SimpIncompleteException;
	
	public void setObjAddress(String objAddress);
	
	public void setSrcAddress(String srcAddress);
	
	public SimpHeader getHead() ;

	public void setHead(SimpHeader head);

	public SimpBody getBody() ;

	public void setBody(SimpBody body) ;
	
	public boolean hasBody();
	
	public short getMainId();
	
	public short getMoudleId();
	/**
	 * 消息源路径增加一
	 * @param contexName
	 */
	public void addSrcAddress(String contexName);
	
	public void decObjAddress(String contexName);
	/**
	 * 消息目的地址减一
	 */
	public void decObjAddress();
	/**
	 * 返回消息目的地址最后一个域
	 * @return
	 */
	public String getLastObjAddress();
}
